import { Pie } from '@ant-design/plots';
import React from 'react';
type BaseLineProps = {
  data?: { type: string; num: number }[];
};

const BasePie: React.FC<BaseLineProps> = (props) => {
  const { data = [] } = props;
  const config = {
    data: data,
    angleField: 'num',
    colorField: 'type',
    label: {
      text: 'num',
      style: {
        fontWeight: 'bold',
      },
    },
    legend: {
      color: {
        title: false,
        position: 'right',
        rowPadding: 5,
      },
    },
  };
  return <Pie {...config} />;
};

export default BasePie;
